﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace HomeCloudStorageSystem.Models
{
    /// <summary>
    /// 用户模型
    /// </summary>
    [Table("Users")]
    public class User
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        [Required(ErrorMessage = "登录密码不能为空")]
        public string Password { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string? Phone { get; set; }
        /// <summary>
        /// 用户权限
        /// </summary>
        [Required(ErrorMessage = "用户权限不能为空")]
        public string Permission { get; set; }
        /// <summary>
        /// 家庭角色
        /// </summary>
        [Required(ErrorMessage = "用户家庭角色不能为空")]
        public string Role { get; set; }
        /// <summary>
        /// 注册时间
        /// </summary>
        [Required(ErrorMessage = "注册时间不能为空")]
        public string RegisterDate { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string HeadImag { get; set; }
        /// <summary>
        /// 用户状态
        /// </summary>
        [Required(ErrorMessage = "用户状态不能为空")]
        public int State { get; set; }
    }
}
